package com.itheima.chapter10.paralleltools;

import java.util.HashMap;

public class Demo {
    public static void main(String[] args) throws InterruptedException {
        HashMap<String,String> ht =new HashMap<>();
        Thread t1 =new Thread(()->{
            for (int i = 0; i < 25; i++) {
                ht.put(i+"",i+"");
            }
        });
        Thread t2 =new Thread(()->{
            for (int i = 25; i < 51; i++) {
                ht.put(i+"",i+"");
            }
        });
        t1.start();
        t2.start();
        System.out.println("------------");
        Thread.sleep(1000);
        for (int i = 0; i < 51; i++) {
            System.out.println(ht.get(i+""));
        }
    }
}
